//
//  EntityManager.h
//  MapLink
//
//  Created by meng on 5/28/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>
@class NotificationEntity;
@class UserLocationEntity;
@class GroupEntity;


@interface EntityManager : NSObject {
	NSMutableArray *notificationArray;
	NSMutableArray *groupArray;
	NSMutableArray *userLocationArray;

}

+ (NSString *) getDocumentFolder;
+ (void) copyDatabaseIfNeeded ;
+ (NSString *) getDBPath ;
+ (void) finalizeStatements;
+ (NSString *) getCurrentDateTimeSqlFormat;
+ (NSDecimalNumber *) convertFromFloat:(float) num; 
+ (int) getCount: (NSString *) sqlText;
+ (NSString *) getDeviceUUID;


- (void) removeNotification:(NotificationEntity *)notificationObj;
- (void) addNotification:(NotificationEntity *)notificationObj;
- (void) removeAllNotifications;
- (NSMutableArray*) getNotificationList:(NSString *)group;

- (void) removeUserLocation:(UserLocationEntity *) userLocationObject;
- (void) addUpdateUserLocation:(UserLocationEntity *) userLocationObject;
- (void) removeAllUserLocations;
- (NSMutableArray *) getUserLocationsList;
- (UserLocationEntity *) getUserLocation: (NSString *) userName;


- (void) addUpdateGroup:(GroupEntity *) groupObject;
- (void) removeAllGroups;
- (NSMutableArray *) getGroupsList;
- (GroupEntity *) getGroup: (NSString *) groupName;

+ (void) clearDatabase:(EntityManager *) entityMgr;

// for testing
+ (void) test:(EntityManager *) entityMgr; 

@end
